%羊齿叶草
N=10000;
v=rand(N,1);
a=[0.5;0];b=[0.57;-0.036];
c=[0.408;0.0893];d=[0.1075;0.27];   %4个固定点
A=[0,0;0,0.27]; %4个变换矩阵
B=[-0.139,0.263;0.246,0.224];
C=[0.17,-0.215;0.222,0.176];
D=[0.781,0.034;-0.032,0.739];
u=[0;0];    %出发点
for k=2:N
vv=v(k);
    if vv<=.02
        u(:,k)=A*u(:,k-1)+ a;
    elseif vv<=.17
        u(:,k)=B*u(:,k-1)+ b;
    elseif vv<=.3
        u(:,k)=C*u(:,k-1)+ c;
    else
        u(:,k)=D*u(:,k-1)+ d;
    end
end
plot(u(1,:),u(2,:),'.','markersize',4)